<?php

namespace app\admin\controller;
use app\base\controller\Base;
use think\Request;
use think\Cache;
use think\Config;
use think\Session;


//资金流水日志
class Timu extends Base
{
    public  $model;

    public function __construct()
    {
   $this->model = model("UsersTimu");
        parent::__construct();

    }

    /**
     * @return \think\response\Json  询价历史
     */
    public function index()
    {//
        //搜索条件 时间 用户号码
        $where = [];

        //时间的处理

     $res = $this->model->timu_page($where);

     return   resJson(1,$this->ecLang("query"),$res['res'],$res['pageInfo']);
    }






    //保存用户信息
 public function save(){


        $data = [];



        $data['wenti'] = $this->wenti;
        $data['daan'] = $this->daan;
        $data['getgrade'] = $this->getgrade;

        $res = $this->model->save($data);
        if($res){
            return    sucessJson("添加成功");
        }else{
            return    failJson("添加失败");
        }

    }


    public function updateit(){

        $data = [];

        $data['wenti'] = $this->wenti;
        $data['daan'] = $this->daan;
        $data['getgrade'] = $this->getgrade;


        $res = $this->model->save($data,['id'=>$this->id]);
        if($res){
            return  sucessJson("更新成功");
        }else{
            return     failJson("更新失败");
        }
    }




    public function del(){
        $res =   $this->model->delete(['id'=>$this->id]);
        if($res){
            return     sucessJson("删除成功");
        }else{
            return    failJson("删除失败");
        }
    }







}
